$(() => {
    let myAjax = function (type, url, data, success) {
        let contentType = 'application/x-www-form-urlencoded'
        let processData = true
        if (data instanceof FormData) {
            contentType = false
            processData = false
        }
        $.ajax({
            type,
            url: 'http://localhost:8080/api/v1' + url,
            headers: {
                Authorization: localStorage.getItem('dsj_token')
            },
            data,
            contentType,
            processData,
            success

        })
    }

    window.myAjax = myAjax
})